#region [file: LancamentoFinanceiroDAL.cs, author: Lucas Bittencourt]
// File:    LancamentoFinanceiroDAL.cs
// Author:  Lucas Bittencourt
// Created: terça-feira, 25 de outubro de 2011 08:26:29
// Purpose: Defines dao implementation class for class LancamentoFinanceiro
#endregion

using System;
using System.Collections.Generic;
using System.Text;
using System.Collections;
using NHibernate.Criterion;
using DA_OOMModel;
using DA_OOMModelIDAL;

namespace DA_OOMNHibernateDAL
{
   /// <summary>
   /// Class that implements methods of ILancamentoFinanceiroDAL interface
   /// </summary>
   public class LancamentoFinanceiroDAL : NHibernateDALBase,  ILancamentoFinanceiroDAL 
   {
      #region CRUD methods
      /// <summary>
      /// Get all instances of LancamentoFinanceiro
      /// </summary>     
      public List<LancamentoFinanceiro> GetLancamentoFinanceiroList()
      {
         return ConvertToGenericList(base.LoadAll(typeof(LancamentoFinanceiro)));
      }
      
      /// <summary>
      /// Get the instances of LancamentoFinanceiro from index firstResult to index maxResult
      /// </summary>
      public List<LancamentoFinanceiro> GetLancamentoFinanceiroList(int firstResult, int maxResult)
      {
         return ConvertToGenericList(base.LoadAll(typeof(LancamentoFinanceiro), firstResult, maxResult));
      }

      /// <summary>
      /// Load the instance of LancamentoFinanceiro according its primary key instance.
      /// </summary>
      public LancamentoFinanceiro Load(LancamentoFinanceiroPK lancamentoFinanceiroPK)
      {
         IList cs = new ArrayList();
         string[] paramNames = new string[] { "LncIdLancamento" };
         object[] values = new object[] { lancamentoFinanceiroPK.LncIdLancamento };
         for (int i = 0; i < paramNames.Length; i++)
             cs.Add(Expression.Eq(paramNames[i], values[i]));

         IList list = base.FindByCriterions(typeof(LancamentoFinanceiro), cs);
         return (((list != null) && (list.Count > 0)) ? (LancamentoFinanceiro)list[0] : null);
      }

      /// <summary>
      /// Query the instances of LancamentoFinanceiro according its example instance.
      /// </summary>
      public List<LancamentoFinanceiro> QueryByExample(LancamentoFinanceiro lancamentoFinanceiro)
      {
         return ConvertToGenericList(base.QueryByExample(typeof(LancamentoFinanceiro), lancamentoFinanceiro));
      }

      /// <summary>
      /// Query the instances of LancamentoFinanceiro according its example instance from index firstResult to index maxResult
      /// </summary>
      public List<LancamentoFinanceiro> QueryByExample(LancamentoFinanceiro lancamentoFinanceiro, int firstResult, int maxResult)
      {
         return ConvertToGenericList(base.QueryByExample(typeof(LancamentoFinanceiro), lancamentoFinanceiro, firstResult, maxResult));
      }
      
      /// <summary>
      /// Insert the instances of LancamentoFinanceiro
      /// </summary>
      public void Insert(LancamentoFinanceiro lancamentoFinanceiroObject)
      {
         base.Save(lancamentoFinanceiroObject);
      }
      
      /// <summary>
      /// Update the instances of LancamentoFinanceiro
      /// </summary>
      public void Update(LancamentoFinanceiro lancamentoFinanceiroObject)
      {
         base.Update(lancamentoFinanceiroObject);
      }
      
      /// <summary>
      /// Delete the instances of LancamentoFinanceiro
      /// </summary>
      public void Delete(LancamentoFinanceiro lancamentoFinanceiroObject)
      {
         base.Delete(lancamentoFinanceiroObject);
      }
      #endregion
      
   
      /// <summary>
      /// Find the instances of LancamentoFinanceiro according to its attribute lncDtLancamento
      /// </summary>
      public List<LancamentoFinanceiro> FindByLncDtLancamento(DateTime lncDtLancamento) 
      {
         IList cs = new ArrayList();
         cs.Add(Expression.Eq("LncDtLancamento", lncDtLancamento));
         return ConvertToGenericList(base.FindByCriterions(typeof(LancamentoFinanceiro), cs));
      }
      
      /// <summary>
      /// Find the instances of LancamentoFinanceiro according to its attribute lncDtLancamento, 
      /// and the result is from index firstResult to  index maxResult
      /// </summary>
      public List<LancamentoFinanceiro> FindByLncDtLancamento(DateTime lncDtLancamento, int firstResult, int maxResult)
      {
         IList cs = new ArrayList();
         cs.Add(Expression.Eq("LncDtLancamento", lncDtLancamento));
         return ConvertToGenericList(base.FindByCriterions(typeof(LancamentoFinanceiro), cs, firstResult, maxResult));
      }
      
      
      /// <summary>
      /// Find the instances of LancamentoFinanceiro according to its attribute lncDtRegistro
      /// </summary>
      public List<LancamentoFinanceiro> FindByLncDtRegistro(DateTime lncDtRegistro) 
      {
         IList cs = new ArrayList();
         cs.Add(Expression.Eq("LncDtRegistro", lncDtRegistro));
         return ConvertToGenericList(base.FindByCriterions(typeof(LancamentoFinanceiro), cs));
      }
      
      /// <summary>
      /// Find the instances of LancamentoFinanceiro according to its attribute lncDtRegistro, 
      /// and the result is from index firstResult to  index maxResult
      /// </summary>
      public List<LancamentoFinanceiro> FindByLncDtRegistro(DateTime lncDtRegistro, int firstResult, int maxResult)
      {
         IList cs = new ArrayList();
         cs.Add(Expression.Eq("LncDtRegistro", lncDtRegistro));
         return ConvertToGenericList(base.FindByCriterions(typeof(LancamentoFinanceiro), cs, firstResult, maxResult));
      }
      
      
      /// <summary>
      /// Find the instances of LancamentoFinanceiro according to its attribute lncVlLancamento
      /// </summary>
      public List<LancamentoFinanceiro> FindByLncVlLancamento(decimal lncVlLancamento) 
      {
         IList cs = new ArrayList();
         cs.Add(Expression.Eq("LncVlLancamento", lncVlLancamento));
         return ConvertToGenericList(base.FindByCriterions(typeof(LancamentoFinanceiro), cs));
      }
      
      /// <summary>
      /// Find the instances of LancamentoFinanceiro according to its attribute lncVlLancamento, 
      /// and the result is from index firstResult to  index maxResult
      /// </summary>
      public List<LancamentoFinanceiro> FindByLncVlLancamento(decimal lncVlLancamento, int firstResult, int maxResult)
      {
         IList cs = new ArrayList();
         cs.Add(Expression.Eq("LncVlLancamento", lncVlLancamento));
         return ConvertToGenericList(base.FindByCriterions(typeof(LancamentoFinanceiro), cs, firstResult, maxResult));
      }
      
      
      /// <summary>
      /// Find the instances of LancamentoFinanceiro according to its attribute lncTpLancamento
      /// </summary>
      public List<LancamentoFinanceiro> FindByLncTpLancamento(string lncTpLancamento) 
      {
         IList cs = new ArrayList();
         cs.Add(Expression.Eq("LncTpLancamento", lncTpLancamento));
         return ConvertToGenericList(base.FindByCriterions(typeof(LancamentoFinanceiro), cs));
      }
      
      /// <summary>
      /// Find the instances of LancamentoFinanceiro according to its attribute lncTpLancamento, 
      /// and the result is from index firstResult to  index maxResult
      /// </summary>
      public List<LancamentoFinanceiro> FindByLncTpLancamento(string lncTpLancamento, int firstResult, int maxResult)
      {
         IList cs = new ArrayList();
         cs.Add(Expression.Eq("LncTpLancamento", lncTpLancamento));
         return ConvertToGenericList(base.FindByCriterions(typeof(LancamentoFinanceiro), cs, firstResult, maxResult));
      }
      
      
      /// <summary>
      /// Find the instances of LancamentoFinanceiro according to its attribute lncTpCreditoDebito
      /// </summary>
      public List<LancamentoFinanceiro> FindByLncTpCreditoDebito(string lncTpCreditoDebito) 
      {
         IList cs = new ArrayList();
         cs.Add(Expression.Eq("LncTpCreditoDebito", lncTpCreditoDebito));
         return ConvertToGenericList(base.FindByCriterions(typeof(LancamentoFinanceiro), cs));
      }
      
      /// <summary>
      /// Find the instances of LancamentoFinanceiro according to its attribute lncTpCreditoDebito, 
      /// and the result is from index firstResult to  index maxResult
      /// </summary>
      public List<LancamentoFinanceiro> FindByLncTpCreditoDebito(string lncTpCreditoDebito, int firstResult, int maxResult)
      {
         IList cs = new ArrayList();
         cs.Add(Expression.Eq("LncTpCreditoDebito", lncTpCreditoDebito));
         return ConvertToGenericList(base.FindByCriterions(typeof(LancamentoFinanceiro), cs, firstResult, maxResult));
      }
      
      
      /// <summary>
      /// Find the instances of LancamentoFinanceiro according to its attribute lncChRepassado
      /// </summary>
      public List<LancamentoFinanceiro> FindByLncChRepassado(Boolean lncChRepassado) 
      {
         IList cs = new ArrayList();
         cs.Add(Expression.Eq("LncChRepassado", lncChRepassado));
         return ConvertToGenericList(base.FindByCriterions(typeof(LancamentoFinanceiro), cs));
      }
      
      /// <summary>
      /// Find the instances of LancamentoFinanceiro according to its attribute lncChRepassado, 
      /// and the result is from index firstResult to  index maxResult
      /// </summary>
      public List<LancamentoFinanceiro> FindByLncChRepassado(Boolean lncChRepassado, int firstResult, int maxResult)
      {
         IList cs = new ArrayList();
         cs.Add(Expression.Eq("LncChRepassado", lncChRepassado));
         return ConvertToGenericList(base.FindByCriterions(typeof(LancamentoFinanceiro), cs, firstResult, maxResult));
      }
      
      /// <summary>
      /// Find <Code>LancamentoFinanceiro</Code> instances by ContaBancaria
      /// </summary>
      /// <param name="contaBancaria"/>
      /// <returns>LancamentoFinanceiro instance list</returns>
      public List<LancamentoFinanceiro> FindByContaBancaria(ContaBancaria contaBancaria)
      {
         IList cs = new ArrayList();
         cs.Add(Expression.Eq("ContaBancaria", contaBancaria));
         return ConvertToGenericList(base.FindByCriterions(typeof(ContaBancaria), cs));
      }
      
      /// <summary>
      /// Find <Code>LancamentoFinanceiro</Code> instances  instances in range firstResult, maxResult by ContaBancaria
      /// </summary>
      /// <param name="contaBancaria"/>
      /// <param name="firstResult">first result to return</param>
      /// <param name="maxResult">max result to return</param>
      /// <returns>LancamentoFinanceiro instance list</returns>
      public List<LancamentoFinanceiro> FindByContaBancaria(ContaBancaria contaBancaria, int firstResult, int maxResult)
      {
         IList cs = new ArrayList();
         cs.Add(Expression.Eq("ContaBancaria", contaBancaria));
         return ConvertToGenericList(base.FindByCriterions(typeof(ContaBancaria), cs, firstResult, maxResult));
      }
      
      /// <summary>
      /// Find <Code>LancamentoFinanceiro</Code> instances by TituloFinanceiro
      /// </summary>
      /// <param name="tituloFinanceiro"/>
      /// <returns>LancamentoFinanceiro instance list</returns>
      public List<LancamentoFinanceiro> FindByTituloFinanceiro(TituloFinanceiro tituloFinanceiro)
      {
         IList cs = new ArrayList();
         cs.Add(Expression.Eq("TituloFinanceiro", tituloFinanceiro));
         return ConvertToGenericList(base.FindByCriterions(typeof(TituloFinanceiro), cs));
      }
      
      /// <summary>
      /// Find <Code>LancamentoFinanceiro</Code> instances  instances in range firstResult, maxResult by TituloFinanceiro
      /// </summary>
      /// <param name="tituloFinanceiro"/>
      /// <param name="firstResult">first result to return</param>
      /// <param name="maxResult">max result to return</param>
      /// <returns>LancamentoFinanceiro instance list</returns>
      public List<LancamentoFinanceiro> FindByTituloFinanceiro(TituloFinanceiro tituloFinanceiro, int firstResult, int maxResult)
      {
         IList cs = new ArrayList();
         cs.Add(Expression.Eq("TituloFinanceiro", tituloFinanceiro));
         return ConvertToGenericList(base.FindByCriterions(typeof(TituloFinanceiro), cs, firstResult, maxResult));
      }
      
      /// <summary>
      /// Find <Code>LancamentoFinanceiro</Code> instances by MovimentacaoFinanceira
      /// </summary>
      /// <param name="movimentacaoFinanceira"/>
      /// <returns>LancamentoFinanceiro instance list</returns>
      public List<LancamentoFinanceiro> FindByMovimentacaoFinanceira(MovimentacaoFinanceira movimentacaoFinanceira)
      {
         IList cs = new ArrayList();
         cs.Add(Expression.Eq("MovimentacaoFinanceira", movimentacaoFinanceira));
         return ConvertToGenericList(base.FindByCriterions(typeof(MovimentacaoFinanceira), cs));
      }
      
      /// <summary>
      /// Find <Code>LancamentoFinanceiro</Code> instances  instances in range firstResult, maxResult by MovimentacaoFinanceira
      /// </summary>
      /// <param name="movimentacaoFinanceira"/>
      /// <param name="firstResult">first result to return</param>
      /// <param name="maxResult">max result to return</param>
      /// <returns>LancamentoFinanceiro instance list</returns>
      public List<LancamentoFinanceiro> FindByMovimentacaoFinanceira(MovimentacaoFinanceira movimentacaoFinanceira, int firstResult, int maxResult)
      {
         IList cs = new ArrayList();
         cs.Add(Expression.Eq("MovimentacaoFinanceira", movimentacaoFinanceira));
         return ConvertToGenericList(base.FindByCriterions(typeof(MovimentacaoFinanceira), cs, firstResult, maxResult));
      }
      
      /// <summary>
      /// Find <Code>LancamentoFinanceiro</Code> instances by RepasseAoCliente
      /// </summary>
      /// <param name="repasseAoCliente"/>
      /// <returns>LancamentoFinanceiro instance list</returns>
      public List<LancamentoFinanceiro> FindByRepasseAoCliente(RepasseAoCliente repasseAoCliente)
      {
         IList cs = new ArrayList();
         cs.Add(Expression.Eq("RepasseAoCliente", repasseAoCliente));
         return ConvertToGenericList(base.FindByCriterions(typeof(RepasseAoCliente), cs));
      }
      
      /// <summary>
      /// Find <Code>LancamentoFinanceiro</Code> instances  instances in range firstResult, maxResult by RepasseAoCliente
      /// </summary>
      /// <param name="repasseAoCliente"/>
      /// <param name="firstResult">first result to return</param>
      /// <param name="maxResult">max result to return</param>
      /// <returns>LancamentoFinanceiro instance list</returns>
      public List<LancamentoFinanceiro> FindByRepasseAoCliente(RepasseAoCliente repasseAoCliente, int firstResult, int maxResult)
      {
         IList cs = new ArrayList();
         cs.Add(Expression.Eq("RepasseAoCliente", repasseAoCliente));
         return ConvertToGenericList(base.FindByCriterions(typeof(RepasseAoCliente), cs, firstResult, maxResult));
      }

      /// <summary>
      /// Convert the IList to the generic List instance.
      /// </summary>
      private List<LancamentoFinanceiro> ConvertToGenericList(IList lancamentoFinanceiros)
      {
         List<LancamentoFinanceiro> lancamentoFinanceiroList = new List<LancamentoFinanceiro>();
         foreach (LancamentoFinanceiro lancamentoFinanceiro in lancamentoFinanceiros)
         {
             lancamentoFinanceiroList.Add(lancamentoFinanceiro);
         }
         return lancamentoFinanceiroList;
      }      
   }
}